package com.heima.wemedia.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.model.wemedia.pojos.WmNewsMaterial;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author jack
 * @data 2024 11:33
 */
@Mapper
public interface WmNewsMaterialMapper extends BaseMapper<WmNewsMaterial> {
    /**
     * 保存文章和素材的关联关系
     * @param newsId   文章id
     * @param materialIds 素材ids
     * @param type  0 内容引用   1 封面引用
     */
    void saveRelationBatch(@Param("newsId") Integer newsId,
                           @Param("materialIds") List<Integer> materialIds,
                           @Param("type") Short type);
}
